﻿<phone:PhoneApplicationPage 
    x:Class="Omnia.Wallet.Views.AboutAndHelpView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:viewmodel="clr-namespace:Omnia.ViewModels;assembly=Omnia.ViewModels"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:UX="clr-namespace:Omnia.UX;assembly=Omnia.UX"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    shell:SystemTray.IsVisible="False">

    <Grid x:Name="LayoutRoot">
        <Grid.Background>
            <ImageBrush Stretch="{Binding GlobalSettings.BackgroundImageStretch}" ImageSource="{Binding BackgroundImageSource, Mode=OneWay}"/>
        </Grid.Background>
        <Grid.DataContext>
            <viewmodel:AboutAndHelpViewModel/>
        </Grid.DataContext>
        <controls:Pivot Title="{StaticResource IDS_PAGE_TITLE}">
            <!--枢轴项一-->
            <controls:PivotItem Header="{StaticResource IDS_HEADER_ABOUTVIEW_ABOUT}">
                <Grid>
                    <ScrollViewer>
                        <StackPanel>
                            <TextBlock Style="{StaticResource PhoneTextTitle2Style}" 
                                       Text="{StaticResource IDS_APP_TITLE}"/>
                            <TextBlock Style="{StaticResource PhoneTextNormalStyle}"  
                                       Foreground="{StaticResource PhoneChromeBrush}" >
                                <Run Text="{StaticResource IDS_PAGE_TITLE}"/>
                                <LineBreak/>
                                <Run Text="for Windows Phone"/>
                            </TextBlock>
                            
                            <Grid Margin="12"/>
                            
                            <TextBlock Style="{StaticResource PhoneTextTitle3Style}" 
                                       Text="{StaticResource IDS_APP_INFO}"/>
                            <TextBlock Style="{StaticResource PhoneTextNormalStyle}"  
                                       Foreground="{StaticResource PhoneChromeBrush}">
                                <Run Text="{StaticResource IDS_APP_VERSION}"/>
                                <Run Text=" "/>
                                <Run Text="{Binding Version}"/>
                            </TextBlock>
                            <TextBlock Style="{StaticResource PhoneTextNormalStyle}" 
                                       Text="{Binding Path=ReleaseDate, StringFormat=\{0:D\}}" 
                                       Foreground="{StaticResource PhoneChromeBrush}" />
                            <TextBlock Style="{StaticResource PhoneTextNormalStyle}"
                                       Foreground="{StaticResource PhoneChromeBrush}">
                                <Run Text="{Binding Copyright}"/>
                                <LineBreak/>
                                <Run Text="{StaticResource IDS_APP_COPYRIGHT}"></Run>
                            </TextBlock>
                            
                            <Grid Margin="12"/>
                            
                            <TextBlock Style="{StaticResource PhoneTextTitle3Style}" 
                                       Text="{StaticResource IDS_APP_CONTACT}"/>
                            <TextBlock Style="{StaticResource PhoneTextNormalStyle}"  
                                       Foreground="{StaticResource PhoneChromeBrush}" >
                                <Run Text="{StaticResource IDS_APP_AUTHOR}"/>
                                <Run Text=" "/>
                                <Run Text="{StaticResource IDS_APP_AUTHOR_NAME}"/>
                            </TextBlock>
                            <UX:UXHyperLink Content="zhaorong@outlook.com" UrlOrNumber="zhaorong@outlook.com"  LinkType="Email" />
                            <UX:UXHyperLink Content="www.zhaorong.me" UrlOrNumber="www.zhaorong.me" LinkType="Url" />
                            
                            <Grid Margin="12"/>
                            
                            <TextBlock Style="{StaticResource PhoneTextTitle3Style}" 
                                       Text="{StaticResource IDS_APP_FEEDBACK}"/>
                            <UX:UXHyperLink Content="{StaticResource IDS_APP_FEEDBACK_TEXT}" Command="{Binding Path=GotoMarketReviewCommand}" />
                            <UX:UXHyperLink Content="{StaticResource IDS_APP_MARKETPLACE}" Command="{Binding Path=GotoMarketDetailsCommand}" />
                        </StackPanel>
                    </ScrollViewer>
                </Grid>
            </controls:PivotItem>

            <!--枢轴项二-->
            <controls:PivotItem Header="{StaticResource IDS_HEADER_ABOUTVIEW_HELP}">
                <Grid>
                    <ListBox ItemsSource="{Binding HelpCollection}">
                        <ListBox.ItemContainerStyle>
                            <Style TargetType="ListBoxItem">
                                <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                            </Style>
                        </ListBox.ItemContainerStyle>
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <toolkit:ExpanderView Margin="0,12">
                                    <toolkit:ExpanderView.Header>
                                        <TextBlock Style="{StaticResource PhoneTextTitle3Style}" TextWrapping="Wrap">
                                            <Run Text="{Binding Id}"/>
                                            <Run Text=". "/>
                                            <Run Text="{Binding Question}"/>
                                        </TextBlock>
                                    </toolkit:ExpanderView.Header>
                                    <ScrollViewer>
                                        <TextBlock Style="{StaticResource PhoneTextNormalStyle}" Text="{Binding Answer}" TextWrapping="Wrap"/>
                                    </ScrollViewer>
                                </toolkit:ExpanderView>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                </Grid>
            </controls:PivotItem>
        </controls:Pivot>
    </Grid>
    
</phone:PhoneApplicationPage>